<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 12">
<meta name=Originator content="Microsoft Word 12">
<link rel=File-List href="implementers_guide_files/filelist.xml">
<title>C++Script Implementers Guide</title>
<link rel=themeData href="implementers_guide_files/themedata.thmx">
<link rel=colorSchemeMapping
href="implementers_guide_files/colorschememapping.xml">
<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:TrackMoves>false</w:TrackMoves>
  <w:TrackFormatting/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:DoNotPromoteQF/>
  <w:LidThemeOther>EN-GB</w:LidThemeOther>
  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:SplitPgBreakAndParaMark/>
   <w:DontVertAlignCellWithSp/>
   <w:DontBreakConstrainedForcedTables/>
   <w:DontVertAlignInTxbx/>
   <w:Word11KerningPairs/>
   <w:CachedColBalance/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  <m:mathPr>
   <m:mathFont m:val="Cambria Math"/>
   <m:brkBin m:val="before"/>
   <m:brkBinSub m:val="&#45;-"/>
   <m:smallFrac m:val="off"/>
   <m:dispDef/>
   <m:lMargin m:val="0"/>
   <m:rMargin m:val="0"/>
   <m:defJc m:val="centerGroup"/>
   <m:wrapIndent m:val="1440"/>
   <m:intLim m:val="subSup"/>
   <m:naryLim m:val="undOvr"/>
  </m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267">
  <w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 2"/>
  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 3"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
  <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
  <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
  <w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/>
  <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
  <w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
  <w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
  <w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
  <w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
  <w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
  <w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
  <w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
  <w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/>
  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/>
  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
  <w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
  <w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
  <w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
  <w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
  <w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
  <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
  <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
 </w:LatentStyles>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Cambria;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073741899 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-pitch:fixed;
	mso-font-signature:-1610611985 1073750091 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-bidi-font-family:"Times New Roman";}
h2
	{mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-link:"Heading 2 Char";
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:"Cambria","serif";
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;}
h3
	{mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-link:"Heading 3 Char";
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;}
a:link, span.MsoHyperlink
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:purple;
	text-decoration:underline;
	text-underline:single;}
pre
	{mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;}
span.Heading2Char
	{mso-style-name:"Heading 2 Char";
	mso-style-noshow:yes;
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 2";
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-hansi-font-family:Cambria;
	font-weight:bold;}
span.Heading3Char
	{mso-style-name:"Heading 3 Char";
	mso-style-noshow:yes;
	mso-style-priority:9;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"Heading 3";
	font-family:"Cambria","serif";
	mso-ascii-font-family:Cambria;
	mso-hansi-font-family:Cambria;
	color:#4F81BD;
	font-weight:bold;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-unhide:no;
	mso-style-locked:yes;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;
	mso-ascii-font-family:Consolas;
	mso-hansi-font-family:Consolas;}
p.msochpdefault, li.msochpdefault, div.msochpdefault
	{mso-style-name:msochpdefault;
	mso-style-unhide:no;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:115098576;
	mso-list-template-ids:-2103302452;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l0:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1
	{mso-list-id:353843126;
	mso-list-template-ids:163995008;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2
	{mso-list-id:696126788;
	mso-list-template-ids:668920246;}
@list l2:level1
	{mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l2:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3
	{mso-list-id:818767598;
	mso-list-template-ids:623962634;}
@list l3:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l3:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l3:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4
	{mso-list-id:1118569859;
	mso-list-template-ids:-1100082478;}
@list l4:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l4:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l4:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5
	{mso-list-id:1501122572;
	mso-list-template-ids:1302361044;}
@list l5:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l5:level2
	{mso-level-tab-stop:72.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l5:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="3074"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple style='tab-interval:36.0pt'>

<div class=Section1>

<h2><span style='mso-fareast-font-family:"Times New Roman"'>Extending C++Script<o:p></o:p></span></h2>

<p class=MsoNormal>There are different ways to extend C++Script depending on
your needs, as documented below. </p>

<h3><span style='mso-fareast-font-family:"Times New Roman"'>Method 1: Implement
within C++Script<o:p></o:p></span></h3>

<p class=MsoNormal>This is the simplest method, where you just implement the
functionality in C++Script itself. &nbsp;This example shows an example of a
counter implemented using this method. &nbsp;e.g. (<a href="extension1.cpp">extension1.cpp</a>)</p>

<p class=MsoNormal>&nbsp;</p>

<pre style='margin-left:30.0pt'>#include &lt;<span class=SpellE>cppscript</span>&gt;</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=SpellE><span class=GramE>var</span></span> counter1_reset(<span
class=SpellE>var</span> counter1)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>counter1[</span>&quot;value&quot;]=0;</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> counter1_get(<span
class=SpellE>var</span> counter1)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> counter1[&quot;value&quot;]++;</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> counter1(<span
class=SpellE>var</span> <span class=SpellE>initial_value</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>return</span> object(&quot;counter1&quot;).extend</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>reset</span>&quot;, counter1_reset)</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>get</span>&quot;, counter1_get)</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>value</span>&quot;, <span class=SpellE>initial_value</span>);</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> <span
class=SpellE>script_main</span>(<span class=SpellE>var</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=SpellE><span class=GramE>var</span></span> counter = counter1(1);</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> counter[&quot;get&quot;]() );</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> counter[&quot;get&quot;]() );</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> 0;</pre><pre
style='margin-left:30.0pt'>}</pre>

<h3><span style='mso-fareast-font-family:"Times New Roman"'>Method 2: Use a
dispatcher<o:p></o:p></span></h3>

<p class=MsoNormal>A dispatcher (created using the function <span class=GramE><i>dispatcher(</i></span><i>)</i>)
function provides a way for an object to implement the methods on a <i>var</i>.
&nbsp;This is really just a change in syntax. e.g. (<a href="extension2.cpp">extension2.cpp</a>)</p>

<p class=MsoNormal>&nbsp;</p>

<pre style='margin-left:30.0pt'>#include &lt;<span class=SpellE>cppscript</span>&gt;</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=SpellE><span class=GramE>var</span></span> counter2_as_int(<span
class=SpellE>var</span> counter2)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> counter2[&quot;value&quot;]++;</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=GramE>void</span> counter2_clear(<span
class=SpellE>var</span> counter2)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>counter2[</span>&quot;value&quot;] = 0;</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> counter2(<span
class=SpellE>var</span> <span class=SpellE>initial_value</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>return</span> dispatcher( </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>object(</span>&quot;counter2&quot;).extend</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>value</span>&quot;, <span class=SpellE>initial_value</span>)</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=SpellE>as_int</span>&quot;, counter2_as_int)</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>clear</span>&quot;, counter2_clear)</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> <span
class=SpellE>script_main</span>(<span class=SpellE>var</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=SpellE><span class=GramE>var</span></span> counter = counter2(1);</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> 0;</pre><pre
style='margin-left:30.0pt'>}</pre>

<h3><span style='mso-fareast-font-family:"Times New Roman"'>Method 3: Wrap a
C++ object<o:p></o:p></span></h3>

<p class=MsoNormal>The function <i>dynamic::<span class=GramE>create(</span>)</i>
creates a <span class=SpellE>var</span> containing a C++ value of any type, and
<span class=SpellE><i>var</i></span><i>::as&lt;&gt;()</i> accesses the C++
value. &nbsp;You can then create methods around that object. e.g. (<a
href="extension3.cpp">extension3.cpp</a>)</p>

<p class=MsoNormal>&nbsp;</p>

<pre style='margin-left:30.0pt'>#include &lt;<span class=SpellE>cppscript</span>&gt;</pre><pre
style='margin-left:30.0pt'>#include &lt;dynamic/extensions.hpp&gt;</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=GramE>class</span> Counter</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>int</span></span> value;</pre><pre
style='margin-left:30.0pt'><span class=GramE>public</span>:</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>Counter(</span><span
class=SpellE>int</span> <span class=SpellE>initial_value</span>) : value(<span
class=SpellE>initial_value</span>)</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>void</span> reset()</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>value=</span>0;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=SpellE><span class=GramE>int</span></span> get()</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>return</span> value++;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>};</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> counter3_get(<span
class=SpellE>var</span> counter3)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> counter3[&quot;value&quot;].as&lt;Counter&gt;().get();</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=GramE>void</span> counter3_reset(<span
class=SpellE>var</span> counter3)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>counter3[</span>&quot;value&quot;].as&lt;Counter&gt;().reset();</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> counter3(<span
class=SpellE>var</span> <span class=SpellE>initial_value</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>return</span> object(&quot;counter3&quot;).extend</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>value</span>&quot;, create(Counter(<span class=SpellE>initial_value</span>)))</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>get</span>&quot;, counter3_get)</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;<span
class=GramE>reset</span>&quot;, counter3_reset);</pre><pre style='margin-left:
30.0pt'>}<br style='mso-special-character:line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]></pre><pre style='margin-left:30.0pt'><br style='mso-special-character:
line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]></pre><pre style='margin-left:30.0pt'><span class=SpellE><span
class=GramE>var</span></span> <span class=SpellE>script_main</span>(<span
class=SpellE>var</span>)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>var</span></span> counter = counter3(1);</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> counter[&quot;get&quot;]() );</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> counter[&quot;get&quot;]() );</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> 0;</pre><pre
style='margin-left:30.0pt'>}</pre>

<h3><span style='mso-fareast-font-family:"Times New Roman"'>Method 4: Implement
a <span class=SpellE>var_impl</span><o:p></o:p></span></h3>

<p class=MsoNormal>The class<i> dynamic::<span class=SpellE>var_impl</span></i>
is the pure virtual base class of all <span class=SpellE><i>var</i></span>
functionality. &nbsp;Derive from this base class and implement the methods you
need. &nbsp;This method is only suitable for small objects wrapping a single
pointer or value, since these classes are copied by value.
&nbsp;You&nbsp;create a <span class=SpellE><i>var</i></span> containing a
custom <span class=SpellE><i>var_impl</i></span> implementation by passing the
object to <span class=SpellE><i>var</i>'s</span> constructor.<br>
<br>
See the <span class=SpellE>Doxygen</span> documentation for <span class=SpellE><i>var_impl</i></span>
for a description of these methods. &nbsp;The methods you must implement are:</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l4 level1 lfo1;tab-stops:list 36.0pt'><span
     class=GramE><i><span style='mso-fareast-font-family:"Times New Roman"'>void</span></i></span><i><span
     style='mso-fareast-font-family:"Times New Roman"'> <span class=SpellE>copy_to</span>(void
     * p) const</span></i><span style='mso-fareast-font-family:"Times New Roman"'>
     - use this to perform a placement new operation to create the object in
     the specified location.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l4 level1 lfo1;tab-stops:list 36.0pt'><i><span
     style='mso-fareast-font-family:"Times New Roman"'>std::string <span
     class=SpellE>class_<span class=GramE>name</span></span><span class=GramE>(</span>)</span></i><span
     style='mso-fareast-font-family:"Times New Roman"'> - return a class name
     for your object.<o:p></o:p></span></li>
</ul>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>e.g. (<a href="extension4.cpp">extension4.cpp</a>)</p>

<p class=MsoNormal>&nbsp;</p>

<pre style='margin-left:30.0pt'>#include &lt;<span class=SpellE>cppscript</span>&gt;</pre><pre
style='margin-left:30.0pt'>#include &lt;dynamic/extensions.hpp&gt;</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=GramE>class</span> Counter : public <span class=SpellE>var_impl</span><br
style='mso-special-character:line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]></pre><pre style='margin-left:30.0pt'>{</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>int</span></span> value;</pre><pre
style='margin-left:30.0pt'><span class=GramE>public</span>:</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>Counter(</span> <span
class=SpellE>var</span> <span class=SpellE>initial_value</span> ) : value(<span
class=SpellE>initial_value</span>)</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>int</span></span> <span
class=SpellE>as_int</span>() </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; { </pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>return</span> value++; </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>void</span> clear() </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; { </pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>value=</span>0; </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>void</span> <span class=SpellE>copy_to</span>(void*p) const</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>new(</span>p) Counter(*this);</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; std::string <span
class=SpellE>class_<span class=GramE>name</span></span><span class=GramE>()</span></pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>return</span> &quot;Counter&quot;;</pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; }</pre><pre style='margin-left:30.0pt'>};</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=SpellE><span class=GramE>var</span></span> counter4(<span class=SpellE>var</span> <span
class=SpellE>initial_value</span>)</pre><pre style='margin-left:30.0pt'>{</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> <span
class=SpellE>create_impl</span>( Counter(<span class=SpellE>initial_value</span>) );</pre><pre
style='margin-left:30.0pt'>}</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'><span class=SpellE><span class=GramE>var</span></span> <span
class=SpellE>script_main</span>(<span class=SpellE>var</span>)</pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=SpellE><span class=GramE>var</span></span> counter = counter4(1);</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>return</span> 0;</pre><pre
style='margin-left:30.0pt'>}</pre>

<h3><span style='mso-fareast-font-family:"Times New Roman"'>Method 5: Implement
a <span class=SpellE>shared_var_impl</span><o:p></o:p></span></h3>

<p class=MsoNormal>The class <i>dynamic::<span class=SpellE>shared_var_impl</span></i>
is the base class of all objects which are copied by reference (meaning that
copying the <span class=SpellE>var</span> does not copy the underlying object).
The advantage of these objects is that they are not restricted by size.
&nbsp;You assign a <span class=SpellE><i>shared_var_impl</i></span> to a <span
class=SpellE><i>var</i></span> just by passing a pointer to the object to the
constructor of <i>var</i>.<br>
<br>
The methods you must implement are:</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l3 level1 lfo2;tab-stops:list 36.0pt'><span
     class=GramE><i><span style='mso-fareast-font-family:"Times New Roman"'>void</span></i></span><i><span
     style='mso-fareast-font-family:"Times New Roman"'> <span class=SpellE>mark_children</span>(<span
     class=SpellE>gc</span>::<span class=SpellE>garbage_collector</span> &amp;)</span></i><span
     style='mso-fareast-font-family:"Times New Roman"'> - mark any sub-objects
     as reachable by calling <span class=SpellE><i>var_impl</i></span><i>::<span
     class=SpellE>mark_reachable</span>()</i>.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l3 level1 lfo2;tab-stops:list 36.0pt'><i><span
     style='mso-fareast-font-family:"Times New Roman"'>std::string <span
     class=SpellE>class_<span class=GramE>name</span></span><span class=GramE>(</span>)</span></i><span
     style='mso-fareast-font-family:"Times New Roman"'> - return a class name
     for your object.<o:p></o:p></span></li>
</ul>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>e.g. (<a href="extension5.cpp">extension5.cpp</a>)</p>

<p class=MsoNormal>&nbsp;</p>

<pre style='margin-left:30.0pt'>#include &lt;<span class=SpellE>cppscript</span>&gt;</pre><pre
style='margin-left:30.0pt'>#include &lt;dynamic/extensions.hpp&gt;</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'><span
class=GramE>class</span> Counter : public <span class=SpellE>shared_var_impl</span></pre><pre
style='margin-left:30.0pt'>{</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=SpellE><span class=GramE>int</span></span> value;</pre><pre
style='margin-left:30.0pt'><span class=GramE>public</span>:</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>Counter(</span> <span
class=SpellE>var</span> <span class=SpellE>initial_value</span> ) : value(<span
class=SpellE>initial_value</span>)</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; {</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=SpellE><span class=GramE>int</span></span> <span
class=SpellE>as_int</span>() </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; { </pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>return</span> value++; </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; <span
class=GramE>void</span> clear() </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; { </pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>value=</span>0; </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; }</pre><pre
style='margin-left:30.0pt'>&nbsp;</pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp; std::string <span
class=SpellE>class_<span class=GramE>name</span></span><span class=GramE>()</span> </pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; { </pre><pre style='margin-left:30.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
class=GramE>return</span> &quot;Counter&quot;; </pre><pre style='margin-left:
30.0pt'>&nbsp;&nbsp; }</pre><pre style='margin-left:30.0pt'>&nbsp;</pre><pre
style='margin-left:30.0pt'>&nbsp;&nbsp; <span class=GramE>void</span> <span
class=SpellE>mark_children</span>(<span class=SpellE>gc</span>::<span
class=SpellE>garbage_collector</span>&amp;)</pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre><pre
style='margin-left:36.0pt'>};</pre><pre style='margin-left:36.0pt'>&nbsp;</pre><pre
style='margin-left:36.0pt'><span class=SpellE><span class=GramE>var</span></span> counter5(<span
class=SpellE>var</span> <span class=SpellE>initial_value</span>)</pre><pre
style='margin-left:36.0pt'>{</pre><pre style='margin-left:36.0pt'>&nbsp; <span
class=GramE>return</span> new Counter(<span class=SpellE>initial_value</span>);</pre><pre
style='margin-left:36.0pt'>}</pre><pre style='margin-left:36.0pt'>&nbsp;</pre><pre
style='margin-left:36.0pt'><span class=SpellE><span class=GramE>var</span></span> <span
class=SpellE>script_main</span>(<span class=SpellE>var</span>)</pre><pre
style='margin-left:36.0pt'>{</pre><pre style='margin-left:36.0pt'>&nbsp; <span
class=SpellE><span class=GramE>var</span></span> counter = counter5(1);</pre><pre
style='margin-left:36.0pt'>&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:36.0pt'>&nbsp; <span class=SpellE><span class=GramE>writeln</span></span><span
class=GramE>(</span> <span class=SpellE>counter.as_int</span>() );</pre><pre
style='margin-left:36.0pt'>&nbsp; <span class=GramE>return</span> 0;</pre><pre
style='margin-left:36.0pt'>}</pre><pre style='margin-left:36.0pt'>&nbsp;</pre>

<p class=MsoNormal>Your implementation can contain <span class=SpellE><i>var</i></span>
member variables, but there's a catch. &nbsp;If these objects can eventually
point back to your object, then you have a &quot;loop&quot; which isn't garbage
collected. &nbsp;So you should call <i>dynamic:<span class=GramE>:<span
class=SpellE>var</span></span><span class=SpellE>_impl</span>::<span
class=SpellE>as_nonroot</span>()</i> [note that this mechanism is subject to
change] to create a non-root variable. &nbsp;In that case, you must implement
the <span class=SpellE><i>mark_<span class=GramE>children</span></i></span><span
class=GramE><i>(</i></span><i>)</i> method to ensure that your members aren't
collected by the garbage collector.</p>

<h2><span style='mso-fareast-font-family:"Times New Roman"'>Supported platforms<o:p></o:p></span></h2>

<p class=MsoNormal>Builds are checked on these platforms: </p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Microsoft Visual C++ 9.0
     (32-bit, 64-bit, debug, release and CLR)<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'><span
     class=SpellE><span style='mso-fareast-font-family:"Times New Roman"'>Cygwin</span></span><span
     style='mso-fareast-font-family:"Times New Roman"'>, GCC 3.4.4<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Linux (<span
     class=SpellE>Ubuntu</span>), GCC 4.3.2<o:p></o:p></span></li>
</ul>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>Other platforms which are reported to work:</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l5 level1 lfo4;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Mac OSX<o:p></o:p></span></li>
</ul>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>Platforms which don't work:</p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l1 level1 lfo5;tab-stops:list 36.0pt'><span
     class=SpellE><span style='mso-fareast-font-family:"Times New Roman"'>Msys</span></span><span
     style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l1 level1 lfo5;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Interix<o:p></o:p></span></li>
</ul>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>If you get a build working on a platform, please submit a
patch. </p>

<h2><span style='mso-fareast-font-family:"Times New Roman"'>How to contribute<o:p></o:p></span></h2>

<p class=MsoNormal>Please submit suggestions and defects <a
href="http://code.google.com/p/cppscript/issues/list">here</a>. &nbsp;The <a
href="http://code.google.com/p/cppscript/wiki/FutureWork"><span class=SpellE>todo</span>
list</a> contains ideas for future work. &nbsp;Please let me know what you are
up to so I can add you as a project member and make sure work isn't duplicated.
&nbsp;It might be more manageable to provide C++Script as&nbsp;a suite of
libraries rather than as a big lump.<br>
<br>
Please send email to <span class=SpellE>cppscript</span> at <span class=SpellE>calumgrant</span>
<span class=SpellE>dawt</span> net. </p>

<h2><span style='mso-fareast-font-family:"Times New Roman"'>Release checklist<o:p></o:p></span></h2>

<ol style='margin-top:0cm' start=1 type=1>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Ensure that all new
     functionality has unit tests.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Ensure that existing
     unit tests run.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Check build on tested
     platforms.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Rename version number in
     sources, configuration files and manual.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     class=SpellE><span style='mso-fareast-font-family:"Times New Roman"'>Doxygen</span></span><span
     style='mso-fareast-font-family:"Times New Roman"'> the output and review.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Build the tar and zip.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Create a SVN branch for
     the new version.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Copy tar, zip, <span
     class=SpellE>doxygen</span> and manual to the web site.<o:p></o:p></span></li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><span
     style='mso-fareast-font-family:"Times New Roman"'>Update the web pages
     with the new version and release notes.<o:p></o:p></span></li>
</ol>

</div>

</body>

</html>
